﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UniRx.Triggers
{
	// Token: 0x02000444 RID: 1092
	[DisallowMultipleComponent]
	public class ObservableSubmitTrigger : ObservableTriggerBase, IEventSystemHandler, ISubmitHandler
	{
		// Token: 0x060016F2 RID: 5874 RVA: 0x0006299C File Offset: 0x00060D9C
		void ISubmitHandler.OnSubmit(BaseEventData eventData)
		{
			if (this.onSubmit != null)
			{
				this.onSubmit.OnNext(eventData);
			}
		}

		// Token: 0x060016F3 RID: 5875 RVA: 0x000629B8 File Offset: 0x00060DB8
		public IObservable<BaseEventData> OnSubmitAsObservable()
		{
			Subject<BaseEventData> result;
			if ((result = this.onSubmit) == null)
			{
				result = (this.onSubmit = new Subject<BaseEventData>());
			}
			return result;
		}

		// Token: 0x060016F4 RID: 5876 RVA: 0x000629E0 File Offset: 0x00060DE0
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onSubmit != null)
			{
				this.onSubmit.OnCompleted();
			}
		}

		// Token: 0x04000CCE RID: 3278
		private Subject<BaseEventData> onSubmit;
	}
}
